﻿<Application
    x:Class="TealightV5.UI.WinPhone.App"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone">

    <!--Application Resources-->
    <Application.Resources>

        <DataTemplate x:Key="TealightItemTemplate">
            <Grid Width="480">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="65" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>
                <Image
                                        Grid.Row="0"
                                        Grid.Column="0"
                                        Source="{Binding ProfileImageUrl}"
                                        Margin="0,12,0,0"
                                        Width="55"
                                        Height="55"
                                        HorizontalAlignment="Left" />
                <TextBlock
                        Grid.Row="2"
                        Grid.Column="1"
                        Foreground="{StaticResource PhoneSubtleBrush}"
                        Margin="0,12,0,0"
                        TextAlignment="Right"
                        Style="{StaticResource PhoneTextSmallStyle}"
                        Text="{Binding Timestamp}" />
                <TextBlock
                                        Grid.Row="0"
                                        Grid.Column="1"
                                        Foreground="White"
                                        Style="{StaticResource PhoneTextLargeStyle}"
                                        Margin="0,0,0,0"
                                        Text="{Binding Author}" />
                <TextBlock
                                        Grid.Row="1"
                                        Grid.Column="1"
                                        TextWrapping="Wrap"
                                        Margin="0,-24,0,0"
                                        Text="{Binding Title}" />
            </Grid>
        </DataTemplate>
    </Application.Resources>

    <Application.ApplicationLifetimeObjects>
        <!--Required object that handles lifetime events for the application-->
        <shell:PhoneApplicationService
            Launching="Application_Launching" Closing="Application_Closing"
            Activated="Application_Activated" Deactivated="Application_Deactivated" />
    </Application.ApplicationLifetimeObjects>
</Application>